namespace Guia.Elements
{
    using System;
    using System.Diagnostics.Contracts;
    using System.Windows.Automation;
    using Guia.Core;
    using Guia.Locator;

    /// <summary>
    /// Contracts class for the IWindow interface.
    /// </summary>
    [ContractClassFor(typeof(IWindow))]
    public class WindowContracts : IWindow
    {
        #region Implementation of IUiElement

        /// <summary>
        /// Gets the underlying AutomationElement of this UiElement.
        /// </summary>
        public AutomationElement AutomationElement
        {
            get { return null; }
        }

        /// <summary>
        /// Gets the tooltip text of this UiElement.
        /// If no tooltip is defined, an empty string is returned.
        /// </summary>
        public string ToolTip
        {
            get { return default(string); }
        }

        /// <summary>
        /// Gets the parent UiElement of this UiElement.
        /// </summary>
        public UiElement ParentElement
        {
            get { return null; }
        }

        /// <summary>
        /// Gets the name of this UiElement.
        /// </summary>
        public string Name
        {
            get { return default(string); }
        }

        /// <summary>
        /// Gets the AutomationId of this UiElement.
        /// </summary>
        public string AutomationId
        {
            get { return default(string); }
        }

        /// <summary>
        /// Gets a value indicating whether the current element is enabled or not.
        /// </summary>
        public bool IsEnabled
        {
            get { return default(bool); }
        }

        /// <summary>
        /// Gets a value indicating whether IsOffscreen is true or not.
        /// </summary>
        public bool IsOffscreen
        {
            get { return default(bool); }
        }

        /// <summary>
        /// Gets the Window whicht contains this UiElement. 
        /// </summary>
        public IWindow ParentWindow
        {
            get { return null; }
        }

        /// <summary>
        /// Gets all UiElement objects of the given type within this UiElement.
        /// </summary>
        /// <typeparam name="T">The desired type of the elements.</typeparam>
        /// <returns>All internal UiElements of the given type within this UiElement.</returns>
        public T[] GetAll<T>() where T : UiElement
        {
            return null;
        }

        /// <summary>
        /// Gets the UiElement object of the given type and the given automationId within this UiElement.
        /// </summary>
        /// <typeparam name="T">The desired type of the element.</typeparam>
        /// <param name="automationId">The desired automationId of the element.</param>
        /// <returns>The internal UiElement of the given type and the given automationId within this UiElement.</returns>
        public T Get<T>(string automationId) where T : UiElement
        {
            return null;
        }

        /// <summary>
        /// Gets the UiElement object of the given type and the given name within this UiElement.
        /// </summary>
        /// <typeparam name="T">The desired type of the element.</typeparam>
        /// <param name="name">The desired name of the element.</param>
        /// <returns>The internal UiElement of the given type and the given name within this UiElement.</returns>
        public T GetByName<T>(string name) where T : UiElement
        {
            return null;
        }

        /// <summary>
        /// Gets the UiElement object of the given type and the given SearchCondition within this UiElement.
        /// </summary>
        /// <typeparam name="T">The desired type of the element.</typeparam>
        /// <param name="condition">The desired SearchCondition for the element.</param>
        /// <returns>The internal UiElement of the given type and the given SearchCondition within this UiElement.</returns>
        public T Get<T>(SearchCondition condition) where T : UiElement
        {
            return null;
        }

        /// <summary>
        /// Gets all the UiElements object of the given type and the given SearchCondition within this UiElement.
        /// </summary>
        /// <typeparam name="T">The desired type of the elements.</typeparam>
        /// <param name="condition">The desired SearchCondition for the elements.</param>
        /// <returns>The internal UiElement objects of the given type and the given SearchCondition within this UiElement.</returns>
        public T[] GetAll<T>(SearchCondition condition) where T : UiElement
        {
            return null;
        }

        /// <summary>
        /// Gets the UiElement object with the given SearchCondition within this UiElement.
        /// </summary>
        /// <param name="condition">The desired SearchCondition for the element.</param>
        /// <returns>The internal UiElement object with the given SearchCondition.</returns>
        public UiElement Get(SearchCondition condition)
        {
            return null;
        }

        /// <summary>
        /// Gets the UiElement object with the given automationId within this UiElement.
        /// </summary>
        /// <param name="automationId">
        /// The desired automationId of the element.
        /// </param>
        /// <returns>
        /// The internal UiElement with the given automationId within this UiElement.
        /// </returns>
        public UiElement Get(string automationId)
        {
            return null;
        }

        /// <summary>
        /// Gets the UiElement object with the given name within this UiElement.
        /// </summary>
        /// <param name="name">
        /// The desired name of the element.
        /// </param>
        /// <returns>
        /// The internal UiElement with the given name within this UiElement.
        /// </returns>
        public UiElement GetByName(string name)
        {
            return null;
        }

        /// <summary>
        /// Gets all the UiElement objects with the given SearchCondition within this UiElement.
        /// </summary>
        /// <param name="condition">The desired SearchCondition for the elements.</param>
        /// <returns>The internal UiElement objects with the given SearchCondition.</returns>
        public UiElement[] GetAll(SearchCondition condition)
        {
            return null;
        }

        /// <summary>
        /// Gets the defined UI Automation-Pattern from this element.
        /// </summary>
        /// <typeparam name="T">The desired UI Automation-Pattern</typeparam>
        /// <returns>The desired UI Automation-Pattern.</returns>
        /// <exception cref="OperationNotSupportedException"/>
        public T GetPattern<T>() where T : BasePattern
        {
            return null;
        }

        /// <summary>
        /// Performs a right-click on this UiElement.
        /// </summary>
        public void ClickRight()
        {
            return;
        }

        /// <summary>
        /// Performs a left-click on this UiElement.
        /// </summary>
        public void ClickLeft()
        {
            return;
        }

        /// <summary>
        /// Performs a double-click on this UiElement.
        /// </summary>
        public void DoubleClick()
        {
            return;
        }

        /// <summary>
        /// Sets the focus to this UiElement.
        /// </summary>
        public void SetFocus()
        {
            return;
        }

        #endregion

        #region Implementation of IWindow

        /// <summary>
        /// Gets the open MessageBox instance with the given name as title.
        /// </summary>
        /// <param name="name">The name of the MessageBox.</param>
        /// <returns>The MessageBox with the given title.</returns>
        public MessageBox GetMessageBox(string name)
        {
            Contract.Requires<ArgumentNullException>(name != null);
            return null;
        }

        /// <summary>
        /// Gets the SaveFileDialog instance of this window with the given name as title.
        /// </summary>
        /// <param name="name">The name of the SaveFileDialog.</param>
        /// <returns>The SaveFileDialog with the given title.</returns>
        public SaveFileDialog GetSaveFileDialog(string name)
        {
            Contract.Requires<ArgumentNullException>(name != null);
            return null;
        }

        /// <summary>
        /// Gets the SaveFileDialog of this window with the default-title.
        /// </summary>
        /// <returns>The default-titled SaveFileDialog.</returns>
        public SaveFileDialog GetSaveFileDialog()
        {
            return null;
        }

        /// <summary>
        /// Gets the OpenFileDialog instance of this window with the given name as title.
        /// </summary>
        /// <param name="name">The name of the OpenFileDialog.</param>
        /// <returns>The OpenFileDialog with the given title.</returns>
        public OpenFileDialog GetOpenFileDialog(string name)
        {
            Contract.Requires<ArgumentNullException>(name != null);
            return null;
        }

        /// <summary>
        /// Gets the OpenFileDialog of this window with the default-title.
        /// </summary>
        /// <returns>The default-titled OpenFileDialog.</returns>
        public OpenFileDialog GetOpenFileDialog()
        {
            return null;
        }

        /// <summary>
        /// Maximizes the window.
        /// </summary>
        /// <exception cref="OperationNotSupportedException">If maximizing is not supported in the current context.</exception> 
        public void Maximize()
        {
            return;
        }

        /// <summary>
        /// Closes the window.
        /// </summary>
        public void Close()
        {
            return;
        }

        /// <summary>
        /// Minimizes the window.
        /// </summary>
        /// <exception cref="OperationNotSupportedException">If minimizing is not supported in the current context.</exception> 
        public void Minimize()
        {
            return;
        }

        /// <summary>
        /// Recovers the normal window-size. 
        /// </summary>
        public void RecoverNormal()
        {
            return;
        }

        /// <summary>
        /// Get the window's visual state.
        /// </summary>
        /// <returns>The current visual state of the window</returns>
        public WindowVisualState GetVisualState()
        {
            return default(WindowVisualState);
        }

        /// <summary>
        /// Get the menu with the given automationId.
        /// </summary>
        /// <param name="automationId">The automationId of the desired Menu</param>
        /// <returns>A Menu instance.</returns>
        public Menu GetMenu(string automationId)
        {
            Contract.Requires<ArgumentNullException>(automationId != null);
            return null;
        }

        #endregion
    }
}